﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace euromilhoes
{
    public partial class Form1 : Form
    {
        private static Random r1 = new Random();
        public Form1()
        {
            InitializeComponent();
        }


        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = " ";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int i; string s1;  int[] en=new int[5];//5 nrs 
            int[] en2=new int[2];//2nrs
            for (i = 0; i < 5; i++)
            {
                int ln=0;
                do{ln=r1.Next(1,51);}
                while(en.Contains(ln));
                en[i]=ln;
            }
                     for (i = 0; i < 2; i++)
            {
                int ln=0;
                do{ln=r1.Next(1,12);}
                while(en2.Contains(ln));
                en2[i]=ln;
            }
                     string n1 = en[0].ToString();string n2=en[1].ToString();string n3 = en[2].ToString();string n4=en[3].ToString();string n5 = en[4].ToString();
                     string e1 = en2[0].ToString();string e2=en2[1].ToString();

                     s1 = n1 + " - " + n2 + " - " + n3 + " - " + n4 + " - " + n5 + " + " + e1 + " + " + e2;
               textBox1.Text = s1;
        }
    }
    }
